// The following example is borrowed from
// https://vuejs.org/v2/guide/custom-directive.html
// Register a global custom directive called `v-focus`

Vue.directive('focus', {
    // 当绑定的element插入到Dom中
    inserted: function(el) {
        //这个element的到焦点
        el.focus();
    }
})